package com.heima.article.job;

import com.heima.article.service.HotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author mrchen
 * @date 2022/8/9 9:27
 */
@Component
@Slf4j
public class ComputeHotArticleJob {

    @Autowired
    HotArticleService hotArticleService;

    @XxlJob("computeHotArticleJob")
    public ReturnT handleHotArticleJob(String params){
        log.info("开始 处理  定时统计热点文章  任务=====================>");
        hotArticleService.computeHotArticle();
        // 计算热点文章
        log.info("结束 处理  定时统计热点文章  任务=====================>");
        return ReturnT.SUCCESS;
    }
}
